package com.dangdang.sharding.listener.spring;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import com.dangdang.sharding.listener.event.BizEvent;
import com.dangdang.sharding.listener.event.UserEvent;
import com.dangdang.sharding.listener.source.BizEventPublisher;
import com.dangdang.sharding.listener.source.UserEventPublisher;
import com.dangdang.sharding.listener.spring.config.ListenerConfig;

public class Client {

	public static void main(String[] args) {
		AnnotationConfigApplicationContext ac=new AnnotationConfigApplicationContext(ListenerConfig.class);
		UserEventPublisher userPublisher = ac.getBean(UserEventPublisher.class);
		userPublisher.publish(new UserEvent("xxx", "123456"));
		BizEventPublisher bizPublisher = ac.getBean(BizEventPublisher.class);
		bizPublisher.publish(new BizEvent("xxx"));
	}

}
